package com.bauer.base.jvm;

/**
 * @Author ：rui.wei
 * @Date ：Created in 10:32 2019/2/12
 * @Description：
 */
public class StackOverFlowErrorDemo {

    private int stackLength = 1;

    public void deep(){
        stackLength++;
        int i = 0;
        int j = 0;
        deep();
    }

    /**
     * vm args
     *  栈帧  就是执行某个方法时 执行时所需的大小
     *  方法中的局部变量越大  栈的深度越小
     * @param args
     */
    public static void main(String[] args) {
        StackOverFlowErrorDemo stackOverFlowError =  new StackOverFlowErrorDemo();
        try {
            stackOverFlowError.deep();
        } catch (Throwable e) {
            System.out.println(stackOverFlowError.stackLength);
        }

    }
}
